using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;

namespace Helpers
{
  public class SecureHelper
  {
    public static string GetMD5(string src)
    {
      MD5 md5 = new MD5CryptoServiceProvider();
      Encoding encoding = Encoding.ASCII;
      byte[] bSrc = encoding.GetBytes(src);
      byte[] bRes = md5.ComputeHash(bSrc);
      string result = string.Empty;
      foreach (byte b in bRes)
        result += b.ToString("X").PadLeft(2, '0');
      return result;
    }
  }
}
